<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
     /* Object object =request.getSession().getAttribute("userAccount");
     String account="";
     
     if(null!=object){
        account= (String)object;
     } */
     // ${sessionScope.userAccount}  通过EL表达式从session获取值
     // EL表达式  取值
     // JSTL 控制显示 
     
 %>
<!DOCTYPE html>
<html>

<head>
 <base href="<%=basePath%>">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="Web前端视频教程,大数据视频教程,HTML5视频教程,UI视频教程,PHP视频教程,java视频教程,python基础教程">
    <meta name="description" content="智游教育在线课程视频,为您提供java,python,HTML5,UI,PHP,大数据等学科经典视频教程在线浏览学习,精细化知识点解析,深入浅出,想学不会都难,智游教育,学习成就梦想！">
    <meta name="author" content="舒涛">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/base.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/css.css">
    <link rel="icon" href="favicon.png" type="image/png" />
    <title>在线公开课-智游教育|java|大数据|HTML5|python|UI|PHP视频教程</title>
    <!--jar包的位置！！  -->
    <script src="${pageContext.request.contextPath}/js/jquery-1.12.4.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/gVerify.js"></script>
       
      <script type="text/javascript">
	    	
	       /* 注册和用户名两个div的显示互换 */
		$(function() {
		    // alert("${userAccount}");
			if (null != "${sessionScope.userAccount}"&& "${sessionScope.userAccount}" != "") {
				$("#regBlock").css("display", "none");
				$("#userBlock").css("display", "block");
			} else {
				$("#regBlock").css("display", "block");
				$("#userBlock").css("display", "none");
			}

			/* 插入验证码框 */
			verifyCode = new GVerify("v_container");
			//alert(verifyCode);

			/* 邮箱校验 */
			$("#regEmail").blur(
					function() {
						var emailVal = $("#regEmail").val();
						//alert(emailVal);
						//不为空时再校验   ------// js 判断不相等  不能使用   !""==xxxx
						if (null != emailVal && "" != emailVal) {
							var params = {
								"email" : emailVal
							};
							//alert(params);
							$.post("validateEmail.action", params, function(
									data) {

								if (data == "success") {
									regIsCommitEmail = true;
									$("#tipEmail").text("该邮箱可用").css("color",
											"green");
								} else {
									regIsCommitEmail = false;
									$("#tipEmail").text("该邮箱已注册，请直接登录").css(
											"color", "red");
								}
							});
						}
					});

			//校验密码
			$("#pswAgain").blur(
					function() {
						var pass01 = $("#regPsw").val();
						var pass02 = $("#pswAgain").val();
						if (null == pass01 || "" == pass01 || null == pass02
								|| "" == pass02) {
							regIsCommitPsw = false;
							$("#tipPass").text("密码不能为空").css("color", "red");
						} else {
							if (pass01 != pass02) {
								regIsCommitPsw = false;
								$("#tipPass").text("两次密码输入不一致，请重新输入").css(
										"color", "red");
							} else {
								regIsCommitPsw = true;
								$("#tipPass").text("");
							}
						}
					});

			/*TT退出功能  */
			$("#loginout").click(function() {
				// alert("+++=+===");
				$.get("loginOut.action", null, function() {
					$("#regBlock").css("display", "block");
					$("#userBlock").css("display", "none");
				});
			});
		});
	
		/* 通过ajax方式把数据插入数据库 */
		var regIsCommitEmail = false;
		var regIsCommitPsw = false;
		var verifyCode;
		function commitRegForm() {
			var code = $("input[name='yzm']").val();
			//alert(code);
			//alert(regIsCommitEmail+","+regIsCommitPsw);
			//verifyCode.validate(code)------jar包中调用的方法
			if (regIsCommitEmail && regIsCommitPsw && verifyCode.validate(code)) {
				/*  //用js提交表单
				$("#regForm").commit(); */
				$.ajax({
					url : "insertUser.action",
					data : $("#regForm").serialize(),
					type : "POST",
					success : function(data) {
						if (data == "success") {
							//注册框消失
							$("#reg").addClass("hidden");
							$("#account").text($("#regEmail").val());
							/*将注册的user信息展示  */
							$("#userBlock").css("display", "block");
							$("#regBlock").css("display", "none");
							
						}
					},
					error : function() {
						alert("请联系管理员");
					}
				});
				return false;
			}
			return false;
		}
	
		/* 登录校验 */
		function commitLogin() {
			var email = $("#loginEmail").val();
			//alert(email);
			var password = $("#loginPassword").val();
			if (null != email && email != "" && null != password && password != "") {
				var params = $("#loginForm").serialize();
				alert(params);
				$.post("loginUser.action", params, function(data) {
					alert(data);
					if (data == "success") {
						/* 登录框消失 */
						$("#login").addClass("hidden");
						$("#account").text($("#loginEmail").val());
						/* 显示注册的user信息 */
						$("#userBlock").css("display", "block");
						$("#regBlock").css("display", "none");
						
					}
	
				});
				return false;
			}
			return false;
		}
	
	
	</script>
   
	

<script>
		function addFavorite2() {
			var url = window.location;
			var title = document.title;
			var ua = navigator.userAgent.toLowerCase();
			if (ua.indexOf("360se") > -1) {
				alert("由于360浏览器功能限制，请按 Ctrl+D 手动收藏！");
			} else if (ua.indexOf("msie 8") > -1) {
				window.external.AddToFavoritesBar(url, title); //IE8
			} else if (document.all) {
				try {
					window.external.addFavorite(url, title);
				} catch (e) {
					alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!');
				}
			} else if (window.sidebar) {
				window.sidebar.addPanel(title, url, "");
			} else {
				alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!');
			}
		}
	</script>

</head>

<body class="w100">

	<%-- <p>asddasd${userAcount}</p> --%>


    <header>
        <div class="container">
            <span>欢迎来到IT培训的黄埔军校——智游教育！</span>
            <div id="regBlock" style="display: none; float: right;">
             <a href="javascript:;" id="reg_open"><img src="${pageContext.request.contextPath}/img/we.png">注册</a>
            <a href="javascript:;" id="login_open"><img src="${pageContext.request.contextPath}/img/we.png">登录</a>
            </div>
            <div id="userBlock" style="display:none; float: right;">
            <a href="javascript:;" id="loginout">退出</a>
            <a href="showMyProfile.action" id="account">${sessionScope.userAccount}</a>
            </div>
           
            <a onclick="JavaScript:addFavorite2()"><img src="${pageContext.request.contextPath}/img/sc.png" draggable="false">加入收藏</a>
            <a onclick="pyRegisterCvt()" target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2580094677&site=qq&menu=yes"><img src="${pageContext.request.contextPath}/img/we.png" draggable="false">联系我们</a>
            <a class="color_e4"><img src="${pageContext.request.contextPath}/img/phone.png" draggable="false"> 0371-88888598&#x3000;&#x3000;4006-371-555</a>

        </div>
    </header>
    <nav class="w100">
        <div class="container">
            <img src="${pageContext.request.contextPath}/img/logo.png" alt="智游教育的logo" onclick="location.href='index.html'" draggable="false">
            <ul class="text_13 f_right">
                <li>
                    <a href="http://zhiyou100.com/" target="_blank">首页</a>
                </li>
                <li class="nav_down">
                    高端课程<img src="${pageContext.request.contextPath}/img/nav_down.png" alt="" draggable="false">
                    <ul id="nav_down" class="t_center">
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/Java/index.html">Java国际</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/vr/index.html">VR</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/html5/index.html">HTML5</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/bigdata/index.html">大数据</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/IS/index.html">信息安全</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/appui/index.html">APP UI</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/php/index.html">PHP</a>
                        </li>
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/python/index.html">Python</a>
                        </li>
                        <!--<li>
                            <a target="_blank" href="http://www.zhiyou100.com/Android/index.html">Android</a>
                        </li>-->
                        <li>
                            <a target="_blank" href="http://www.zhiyou100.com/ios/index.html">iOS</a>
                        </li>
                        <!--<li>
                            <a target="_blank" href="http://www.zhiyou100.com/netop/index.html">网络运营</a>
                        </li>-->
                    </ul>
                </li>
                <li id="gkk" class="nav_choose">
                    <a href="http://zhiyou100.com/videos/" target="_blank">在线公开课</a>
                </li>
                <li>
                    <a href="http://www.zhiyou100.com/zhuanjiashizi/index.html" target="_blank">专家师资</a>
                </li>
                <li>
                    <a href="http://www.zhiyou100.com/gaoxinjiuye/index.html" target="_blank">高薪就业</a>
                </li>
                <li>
                    <a href="http://www.zhiyou100.com/chuangyexueyuan/index.html" target="_blank">创业学员</a>
                </li>
                <li>
                    <a href="http://www.zhiyou100.com/xueyuanzuopin/index.html" target="_blank">学员作品</a>
                </li>
                <li><a href="http://www.zhiyou100.com/zyxw/" target="_blank">智游新闻</a></li>
                <li class="nav_last">
                    <a href="http://www.zhiyou100.com/aboutus/index.html" target="_blank">关于智游</a>
                </li>
            </ul>
        </div>
    </nav>

    <!--banner图-->
    <div class="banner index-banner"></div>

    <!--模块化课程-->
    <div class="course">
        <div class="container">
            <p class="title">模块化课程，从入门到精通，大神并不遥远</p>
            <div class="course-info">
                <table cellspacing="10">
                    <tr>
                        <td colspan="2">
                            <a href="course.action?subjectId=1">
                                <img src="${pageContext.request.contextPath}/img/html5.jpg" alt="" class="image scale" draggable="false">
                                <div class="headline">
                                    <span>Web前端教程</span>
                                    <img src="${pageContext.request.contextPath}/img/arrow.png" alt="">
                                </div>
                            </a>
                        </td>
                        <td>
                            <!--上线时修改id-->
                            <a href="course.action?subjectId=6">
                                <img src="${pageContext.request.contextPath}/img/ui.jpg" alt="" class="image scale" draggable="false">
                                <div class="headline">
                                    <span>UI设计教程</span>
                                    <img src="${pageContext.request.contextPath}/img/arrow.png" alt="">
                                </div>
                            </a>
                        </td>
                        <td rowspan="2" class="one_three">
                            <a href="#" class="opacity5">
                                <img src="${pageContext.request.contextPath}/img/java.jpg" alt="" class="image" draggable="false">
                                <div class="headline">
                                    <span>Java教程</span>
                                    <img src="${pageContext.request.contextPath}/img/arrow.png" alt="">
                                </div>
                            </a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <a href="#" class="opacity5">
                                <img src="${pageContext.request.contextPath}/img/bigdata.jpg" alt="" class="image" draggable="false">
                                <div class="headline">
                                    <span>大数据教程</span>
                                    <img src="${pageContext.request.contextPath}/img/arrow.png" alt="">
                                </div>
                            </a>
                        </td>
                        <td colspan="2">
                            <a href="course.action?subjectId=10">
                                <img src="${pageContext.request.contextPath}/img/python.jpg" alt="" class="image scale" draggable="false">
                                <div class="headline">
                                    <span>Python教程</span>
                                    <img src="${pageContext.request.contextPath}/img/arrow.png" alt="">
                                </div>
                            </a>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <a href="course.action?subjectId=11">
                                <img src="${pageContext.request.contextPath}/img/php.jpg" alt="" class="image scale" draggable="false">
                                <div class="headline">
                                    <span>PHP教程</span>
                                    <img src="${pageContext.request.contextPath}/img/arrow.png" alt="">
                                </div>
                            </a>
                        </td>
                        <td colspan="2" class="three_two">
                            <img src="${pageContext.request.contextPath}/img/qidai.jpg" alt="" class="image" draggable="false">
                            <div class="headline">
                                更多课程，敬请期待...
                            </div>
                        </td>
                    </tr>
                </table>
                <!--马上试听-->
                <a onclick="pyRegisterCvt()"  target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2580094677&site=qq&menu=yes">
                    <div class="audition">高级课程</div>
                </a>
            </div>
        </div>
    </div>


    <!--报名表单-->
    <div class="form_area">
        <div class="container">
            <p class="title"><b>这个世界上可以选择的很多，可以改变命运的选择很少<br />你现在准备好向梦想出发了吗？</b></p>
            <form id="iform" action="/090/plus/dmail.php" enctype="multipart/form-data" method="post">
                <div class="form_line1"></div>
                <div class="form_line2"></div>
                <div class="wrap">
                    <input type="hidden" name="action" value="post" />
                    <input type="hidden" name="diyid" value="3" />
                    <input type="hidden" name="do" value="2" />
                    <input type="hidden" name="ip" value="" />
                    <input type="hidden" name="time" value="" />
                    <div><label for="name">姓名：</label><input name="name" id="name" type="text" class="form-control" /></div>
                    <div><label for="tel">手机号：</label><input name="tel" id="tel" type="text" class="form-control" /></div>
                    <div><label for="qq">QQ：</label><input name="qq" id="qq" type="text" class="form-control" /></div>
                </div>
                <input class="button" type="submit" value="立即报名" />
            </form>
        </div>
    </div>
    <!--页脚-->
    <footer>
        <ul>
            <li>
                <img src="${pageContext.request.contextPath}/img/footer_logo.png" alt="" draggable="false">
            </li>
            <li class="mt25">
                <h3>各校区地址</h3>
                <ul>
                    <li>总部地址<br>中国-郑州经济技术开发区河南省通信产业园六层</li>
                    <li>郑州校区一<br>中国-郑州经济技术开发区第一大街与经北一路</li>
                    <li>郑州校区二<br>中国-郑州经济技术开发区第四大街经开人才市场七楼</li>
                    <li>郑州校区三<br>中国-郑州经济技术开发区第八大街河南省留学生创业园九层、十层</li>
                    <li>西安分校<br>中国-西安莲湖区&#X3000;联系人：梁老师 13201570801</li>
                </ul>
            </li>
            <li class="mt25">
                <h3>联系我们</h3>
                <ul id="foo_icon">
                    <li>中国-郑州经济技术开发区经北三路河南通信产业园六层</li>
                    <li>e-mail:zy@zhiyou100.com</li>
                    <li>电话:4006-371-555 0371-88888598</li>
                    <li class="erwei">
                        <br>
                        <div>
                            <img class="weixin" src="${pageContext.request.contextPath}/img/微信公众号.png" alt="" draggable="false">
                            <img class="weibo" src="${pageContext.request.contextPath}/img/微博公众号.png" alt="" draggable="false">
                        </div>
                    </li>
                </ul>
            </li>
        </ul>
        <div class="record">智游教育 &copy; 豫ICP备17000832号-1 &#X3000;河南智游臻龙教育科技有限公司</div>
    </footer>

    <!--登录注册弹出框-->
    <div class="mask hidden" id="login">
        <div class="mask_content">
            <div class="mask_content_header">
                <img src="${pageContext.request.contextPath}/img/logo.png" alt="" class="ma">
            </div>
            <div class="mask_content_body">
                <form id="loginForm" action="#">
                    <h3>快速登录</h3>
                    <input id="loginEmail" type="email" placeholder="请输入邮箱" name="email">
                    <input id="loginPassword" type="password" placeholder="请输入密码" name="password">
                    <div id="forget">
                        <a href="forgetPassword.action">忘记密码？</a>
                    </div>
                    <input type="submit" onclick="return commitLogin()"  value="登&#x3000;录">
                </form>
            </div>
            <div class="mask_content_footer">
                <span id="login_close">关&#x3000;闭</span>
            </div>
        </div>
    </div>
    <div class="mask hidden" id="reg">
        <div class="mask_content">
            <div class="mask_content_header">
                <img src="${pageContext.request.contextPath}/img/logo.png" alt="" class="ma">
            </div>
            <div class="mask_content_body">
                <form id="regForm" action="insertUser.action">
                    <h3>新用户注册</h3>
                    <input id="regEmail" type="email" placeholder="请输入邮箱" name="email"><span id="tipEmail"></span>
                    <input id="regPsw" type="password" placeholder="请输入密码" name="password">
                    <input id="pswAgain" type="password" placeholder="请再次输入密码" name="psw_again"><span id="tipPass"></span>
                    <div id="yzm" class="form-inline">
                        <input type="text" name="yzm" style="width: 45%; display: inline-block;">
                        <div id="v_container" style="width:45%;height: 40px; float:right;"></div>
                    </div>
                    <input type="submit" onclick="return commitRegForm();" value="注&#x3000;册">
                </form>
            </div>
            <div class="mask_content_footer">
                <span id="reg_close">关&#x3000;闭</span>
            </div>
        </div>
    </div>

   
 
</body>
	<!--弹出框的js引入必须放在<head>之外  -->
  <script src="${pageContext.request.contextPath}/js/index.js"></script>
</html>
